<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button onclick="addMoney()">点击变富</button>
<hr>


<script>
    function addMoney(){
        //console.log('变富了')
       /* let imgE = document.createElement('img');
        imgE.src = '../3.png';
        imgE.width = 200;
        let bodyE = document.querySelector('body');
        bodyE.append(imgE);*/
        let imgE = document.createElement('img');//创建一个img标签
        imgE.src = '../3.png';//添加src属性
        imgE.width = 200;//添加width属性
       let bodyE = document.querySelector('body');//获取body标签
       bodyE.append(imgE);//添加img标签
    }

</script>
</body>
</html>